use mongodb::bson::oid::ObjectId;
use serde::{Deserialize, Serialize};

const MODULE_NAME: &str = "user";

/// 用户信息对象
#[derive(Serialize, Deserialize)]
pub struct User {
    /// 唯一id
    #[serde(rename = "_id")]
    pub id: ObjectId,
    /// 用户名
    #[serde(rename = "Name")]
    pub name: String,
    /// 密码
    #[serde(rename = "Password")]
    pub password: String,
    /// 最近一次登陆时间
    #[serde(rename = "LastLoginTime")]
    pub last_login_time:i64,
    /// 最近一次登陆IP
    #[serde(rename = "LastLoginIp")]
    pub last_login_ip:String,
    /// 创建时间
    #[serde(rename = "CreateTime")]
    pub create_time: i64,
}

/// 模块名
pub fn module_name() -> &'static str {
    return MODULE_NAME;
}
